package models

import "gitee.com/blueskyxi2006/sql-metrics/dao"

//  ServerMetrics Model
//# TYPE emg_loader_cdr gauge
//# HELP emg_loader_cdr for cdr number in latest 30min.
//emg_loader_cdr{label="wab",node="192.168.100.6"} $wabnum
type GroupMetrics struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Level  string  `json:"level"`
	Number int    `json:"number"`
	Node   string `json:"node"`
	IP     string `json:"ip"`
	Host   string `json:"host"`
	Status bool   `json:"status"`
}



func GetAllGroupMetrics(sql string) (sms []*GroupMetrics) {
	dao.DB.Raw(sql).Scan(&sms)

	//if err = dao.DB.Find(&sms).Error; err != nil{
	//	return nil, err
	//}
	return
}


